﻿<Page:BasePage
    xmlns:Page="clr-namespace:Tfs.OnTheRoad.Pages"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:Tfs.OnTheRoad.Controls"
    xmlns:converters="clr-namespace:Tfs.OnTheRoad.Converters"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="Tfs_OnTheRoad.BranchDetailsPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	SupportedOrientations="Portrait" Orientation="Portrait"  ApplicationBarButtons="Refresh,About,Back,GoToWorkItem" 
	shell:SystemTray.IsVisible="True">
    <!--Enabling Page Transitions-->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <phone:PhoneApplicationPage.Resources>
        <converters:BuildImageConverter x:Key="BuildImageConverter"></converters:BuildImageConverter>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Controls:HeaderControl x:Name="HeaderControlPage" Grid.Row="0" NavigationPath="Branch Details"></Controls:HeaderControl>
        
        <!--Pivot Control-->
        <controls:Pivot Grid.Row="1">
            <controls:PivotItem Header="General">
                <ScrollViewer Margin="10,0,10,0">
                    <StackPanel ScrollViewer.VerticalScrollBarVisibility="Auto">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Grid.Row="0" Width="28" HorizontalAlignment="Center"  Source="/Images/BranchIcon.png" VerticalAlignment="Center"></Image>
                            <TextBlock Grid.Column="1" Text="{Binding Path}" VerticalAlignment="Center" Grid.Row="0" Style="{StaticResource DetailsHeaderText}" FontSize="34" Foreground="{StaticResource PhoneAccentBrush}" Margin="10,10,10,0" TextWrapping="Wrap"/>
                        </Grid>
                        <StackPanel Visibility="{Binding DateCreated, Converter={StaticResource FieldHasValueVisibilityConverter}}">
                            <TextBlock Text="Date Created" Foreground="{StaticResource PhoneAccentBrush}" Style="{StaticResource PhoneTextTitle3Style}" FontSize="22" Margin="8,0" Height="27" VerticalAlignment="Top" />
                            <TextBlock Text="{Binding DateCreated}"  Style="{StaticResource PhoneTextTitle3Style}" FontSize="22" Margin="8,0" TextWrapping="Wrap" />
                        </StackPanel>
                        <StackPanel Visibility="{Binding Description, Converter={StaticResource FieldHasValueVisibilityConverter}}">
                            <TextBlock Text="Description" Foreground="{StaticResource PhoneAccentBrush}" Style="{StaticResource PhoneTextTitle3Style}" FontSize="22" Margin="8,0"/>
                            <TextBlock Text="{Binding Description}"  Style="{StaticResource PhoneTextTitle3Style}" FontSize="22" Margin="8,0" TextWrapping="Wrap" />
                        </StackPanel>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>

            <controls:PivotItem Header="Changesets">
                <Controls:ChangesetsListControl ProgressBarVisibility="Visible" x:Name="ChangesetsListControl"></Controls:ChangesetsListControl>
            </controls:PivotItem>
        </controls:Pivot>
        <Controls:FindWorkItemPanel Grid.RowSpan="2" Visibility="Collapsed" VerticalAlignment="Top" />
    </Grid>
</Page:BasePage>